﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MainPage.Master"
	CodeBehind="ReportUT514.aspx.vb" Inherits="RWN.ReportUT514" UICulture="th-TH" Culture="th-TH" %>

<%@ Register Assembly="NumericTextBox" Namespace="NumericTextBoxControl" TagPrefix="cc1" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
	Namespace="System.Web.UI" TagPrefix="asp" %>
<%@ Register Src="ucPopupOfficer.ascx" TagName="ucPopupOfficer" TagPrefix="uc1" %>
<%@ MasterType VirtualPath="~/MainPage.Master" %>
<%@ Register Assembly="Sarayut.ControlLibrary" Namespace="Sarayut.ControlLibrary"
	TagPrefix="cc2" %>
<%@ Register src="ucCalendar.ascx" tagname="ucCalendar" tagprefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
	<script type="text/javascript">
		function open_detail(seldate,filetype,reson,trantype) {
			window.open("ut514_dtl.aspx?seldate=" + seldate + "&filetype=" + filetype + "&reson=" + reson + "&trantype=" + trantype, "ut514_dtl", "location=0,status=0,scrollbars=1,resizable=1");
		}
	</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
	<asp:ScriptManager ID="ScriptManager1" runat="server" 
		EnableScriptGlobalization="True">
	</asp:ScriptManager>
	<div>
		Summary Transaction Interface</div>
	<div>
		<hr />
	</div>
	<div>
		<table>
			<tr>
				<td>
					ตั้งแต่วันที่:
				</td>
				<td>
					<uc2:ucCalendar ID="fromDate" runat="server" ValidationGroup="valid" />
				</td>
				<td>
					ถึงวันที่:
				</td>
				<td>
					<uc2:ucCalendar ID="toDate" runat="server" ValidationGroup="valid" />
				</td>
			</tr>
			<tr>
				<td>
					ประเภทไฟล์:
				</td>
				<td>
					<asp:DropDownList ID="ddlFileType" runat="server">
					<asp:ListItem Value="">-- All File Type --</asp:ListItem>
						<asp:ListItem>IVR XML File</asp:ListItem>
						<asp:ListItem>IVR FTP File</asp:ListItem>
						<asp:ListItem>SBM FTP File</asp:ListItem>
					</asp:DropDownList>
				</td>
				<td>
					สถานะของรายการ :
				</td>
				<td>
					<asp:DropDownList ID="ddlTranStatus" runat="server">
						<asp:ListItem Value="">-- All Transaction Status --</asp:ListItem>
						<asp:ListItem>SUCCESS</asp:ListItem>
						<asp:ListItem>ERROR</asp:ListItem>
					</asp:DropDownList>
				</td>
			</tr>
			<tr>
				<td colspan="4">
					<asp:Button ID="btnSearch" runat="server" Text="ค้นหา" 
						ValidationGroup="valid" />
					&nbsp;<asp:Button ID="btnReset" runat="server" Text="ตั้งค่าใหม่" />
					&nbsp;<asp:Button ID="btnExcel" runat="server" Text="Excel File" />
				</td>
			</tr>
		</table>
	</div>
	<div>
        <asp:GridView ID="gvList" runat="server" AllowPaging="True" 
            AutoGenerateColumns="False" PageSize="20" Width="100%">
		    <AlternatingRowStyle BackColor="White" />
			<Columns>
				<asp:TemplateField HeaderText="ลำดับ">
					<ItemTemplate>
						<asp:Label ID="Label1" runat="server" Text="<%# Container.DataItemIndex+1 %>"></asp:Label>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:BoundField DataField="INTERFACE_DATE" HeaderText="Interface Date" 
					DataFormatString="{0:dd/MM/yyyy}" />
				<asp:BoundField DataField="FILE_TYPE" HeaderText="File Type" />
				<asp:TemplateField HeaderText="Count Transaction">
					<ItemTemplate>
						<asp:HyperLink ID="HyperLink1" runat="server" onclick=""
							Text='<%# Eval("TRANSACTION_COUNT") %>' NavigateUrl='<%# "javascript:open_detail(""" & Eval("INTERFACE_DATE") & """,""" & Eval("FILE_TYPE") & """,""" & Eval("TRANSACTION_REASON") & """,""" & Eval("TRANSACTION_STATUS") & """)" %>'></asp:HyperLink>
					</ItemTemplate>
				</asp:TemplateField>
				<asp:BoundField DataField="TRANSACTION_STATUS" HeaderText="สถานะของ รายการ" />
				<asp:BoundField DataField="TRANSACTION_REASON" HeaderText="Transaction Reason" />
			</Columns>
			<RowStyle HorizontalAlign="Center" />
            <HeaderStyle BackColor="White" Height="30px" />
		    <PagerStyle BackColor="White" />
		    <RowStyle Height="20px" />
		</asp:GridView>
	</div>

	<!-- ไว้เป็น Template สำหรับออก excel -->
	<asp:GridView ID="gvExport" runat="server" AllowPaging="True" 
			AutoGenerateColumns="False" EnableModelValidation="True" PageSize="20" 
			Width="100%">
            <AlternatingRowStyle BackColor="White" />
			<Columns>
				<asp:BoundField DataField="OrderNo" HeaderText="ลำดับ" />
				<asp:BoundField DataField="INTERFACE_DATE" HeaderText="Interface Date" />
				<asp:BoundField DataField="FILE_TYPE" HeaderText="File Type" />			
				<asp:BoundField DataField="TRANSACTION_COUNT" HeaderText="Count Transaction" />
				<asp:BoundField DataField="TRANSACTION_STATUS" HeaderText="สถานะของ รายการ" />
				<asp:BoundField DataField="TRANSACTION_REASON" HeaderText="Transaction Reason" />
			</Columns>
			<RowStyle HorizontalAlign="Center" />
            <HeaderStyle BackColor="White" Height="30px" />
		    <PagerStyle BackColor="White" />
		    <RowStyle Height="20px" />
		</asp:GridView>
</asp:Content>
